package login.service;

import login.dao.UserDao;
import login.dao.UserDaoimpl;
import login.entity.User;

public class UserServiceimpl implements UserService {
	private UserDao userDao = new UserDaoimpl();
	public Boolean register(String username, String password) {
		User user = new User();
		user.setUsername(username);
		user.setPassword(password);
		Integer result = userDao.register(user);
		if (result > 0) {
			return true;
		}
		return false;

	}

	public User login(String username, String password) {
		User user = new User();
		user.setUsername(username);
		user.setPassword(password);
		User u = userDao.login(user);
		return u;

	}
	
	
}
